#include<iostream>
#include<algorithm>
using namespace std;
const int N = 550;
int arr[N][N];
int f[N];
int n;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			int t = min({ i,j,abs(n - i + 1),abs(n - j + 1) });
			cin >> arr[i][j];
			f[t] += arr[i][j];
		}
	}
	int ans = 0;
	for (int i = 1; i <= (n + 1) / 2; i++) {
		ans = max(ans, f[i]);
	}
	cout << ans << endl;
	return 0;
}